﻿{% extends "base.html" %}
{% block title %} {{ user_name }}的日历{% endblock %}
{% block user %} {{ user_name }}的日历{% endblock %}
{% block styles %}{{super()}}
<link href="{{ url_for('static', filename='css/dashboard.css') }}" rel="stylesheet">
<style>
    .col-center-block {
        float: none;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
</style>
{% endblock %}
{% block scripts %}{{super()}}
<script>
    holidays = JSON.parse({{ holidays | tojson | safe}});
    holidaysOffset = JSON.parse({{ holidaysOffset  | tojson | safe}});

</script>
{#<script src="{{ url_for('static', filename='js/holidays.js') }}"></script>#}
<script src="{{ url_for('static', filename='js/partnercalendar.js') }}"></script>
<script>
    // download current calendar
    $(function () {
        $("#download-user").click(function () {
            var date = new Date($('#calendar').fullCalendar('getDate'));
            var month = date.getMonth() + 1;
            var year = date.getYear() + 1900;
            var para = '?userid={{ user_id }}' + '&year=' + year.toString() + '&month=' + month.toString();
            window.location.href = "{{ url_for('bp_plot.user')}}" + para;
        });
    });
</script>
{% endblock %}


{% block content %}

{% include 'partner/event_detail.html' %}
<div class="container-fluid">
    <div class="main">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-center-block">
                {% include 'flash_message.html' %}

                <p class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div type="button" class="btn btn-info" id="download-user">查看 {{ user_name }} 的报表</div>
                    <a class="btn btn-warning" href="{{ url_for('bp_partner.assign', user_id=user_id) }}">给他分配任务</a>
                    <a class="btn btn-success" href="{{ url_for('bp_partner.receive', user_id=user_id) }}">他收到的任务</a>
                    <a class="btn btn-danger" href="{{ url_for('bp_partner.send', user_id=user_id) }}">他发出的任务</a>
                    <a class="btn btn-default" href="{{ url_for('bp_partner.tasks', user_id=user_id) }}">他的填报明细</a>



                </p>

                <h4 class="row page-header">
                    <p class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                        <div id="manhourSummary" style="text-align:center"></div>
                    </p>
                </h4>
                <div>
                    <div id='calendar'></div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}